package com.gl.battleship.services;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import com.gl.battleship.domain.User;
import com.gl.battleship.services.exceptions.UserException;
import com.gl.battleship.services.managers.IGameManager;
import com.gl.battleship.services.managers.IUserManager;
//import com.gl.battleship.services.managers.UsersExpiredManager;

@Service
public class SchedulerUsersExpiredServices implements ISchedulerUsersExpiredServices {
	
	@Autowired
	private IUserManager userManager;
	
	@Autowired
	private IGameManager gameManager;

	private final AtomicInteger counter = new AtomicInteger();

    
    @Scheduled(fixedDelay = 1000)
    public void process() {
             
        try {
        	
			userManager.removeInactiveUsers();
			
			
		} catch (UserException e) {
			e.printStackTrace();
		}
        
       
}
}


